//
// Copyright (c) 2024 BPer
//
#ifndef SRC_BPERRTP_BPERRTPFUAPAYLOAD2_H_
#define SRC_BPERRTP_BPERRTPFUAPAYLOAD2_H_

#include <bperrtp/BPerRtp.h>
#include <bperutil/BPerAvH265.h>
#include <bperutil/BPerAvType.h>

typedef struct{
    int32_t start;
    int32_t end;
    BPerAvcNaluType nri;
    BPerAvcNaluType nalu_type;
}Fua2H264DataCache;

typedef struct{
    int32_t start;
    int32_t end;
    BPerHevcNaluType nri;
    BPerHevcNaluType nalu_type;
}Fua2H265DataCache;

typedef struct{
    // The FUA header.
	int32_t start;
	int32_t end;
    BPerAvcNaluType nri;
    BPerAvcNaluType nalu_type;
    int32_t nb;
    char* payload;
}BPerFua2H264Data;

typedef struct{
    // The FUA header.
	int32_t start;
	int32_t end;
    BPerHevcNaluType nri;
    BPerHevcNaluType nalu_type;
    int32_t nb;
    char* payload;
}BPerFua2H265Data;


typedef struct{
    // The FUA header.
	int32_t start;
	int32_t end;

    int32_t nb;
    char* payload;
}BPerFua2MjpegData;

#ifdef __cplusplus
extern "C"{
#endif
int32_t bPer_decode_h264_fua2(BPerBuffer* buf,Fua2H264DataCache* pkt);
int32_t bPer_decode_h265_fua2(BPerBuffer* buf,Fua2H265DataCache* pkt);

int32_t bPer_encode_h264_fua2(BPerBuffer* buf,BPerFua2H264Data* pkt);
int32_t bPer_encode_h265_fua2(BPerBuffer* buf,BPerFua2H265Data* pkt);
#ifdef __cplusplus
}
#endif
#endif /* SRC_BPERRTP_BPERRTPFUAPAYLOAD2_H_ */
